*************************************************************************
***************Effect of remittances on human rights*********************
*************************************************************************
**************Using STATA for the analysis of the data*******************
*************************************************************************
*********************SUPPLEMENTARY MATERIALS*****************************


*The purpose of these supplementary materials is to show some additional tests on the data
*but they are not part of the paper

*Beginning the analysis of the data. Getting to know the data
***Declaring the data to be time-series
import excel "C:\Users\Any\Google Drive\Remitt - HuRights\Data\Remittances_HHRR.BPSR.xls", sheet("Database") firstrow
encode Country, gen (nation)
xtset nation Year, yearly 
set more off
set matsize 300
tab Year, gen(year)
tab nation, gen (nat)


***EFFECT OF REMITTANCES ON PHYSICAL INTEGRITY RIGHTS (PTS)
gen remprot = Remit_gdp*protest
gen remcivil = Remit_gdp*civil
gen lnpop = ln(population)
gen migra = ln(NetMigrat)
gen lngdp = ln(gdpgrowth)
gen remelect = Remit_gdp*elections 
recode ciri (0=8) (1=7) (2=6) (3=5) (4=4) (5=3) (6=2) (7=1) (8=0), gen (Ciri)
recode Remit_gdp 0.0/5 = 1 5.01/10 = 2 10.01/15 = 3 15.01/20 = 4 20.01/28 = 5, gen (Remit)
recode Ciri 0/1 = 1 2/3 = 2 4/5 = 3 6/7 = 4 8=5, gen (ciri2)


gen lag_remit = Remit_gdp[_n-1]
gen lag_civil = civil[_n-1]
gen lag_remprot = remprot[_n-1]
gen lag_remcivil = remcivil[_n-1]
gen lag_mepv = mepv[_n-1]
gen lag_imf = imf[_n-1]
gen lag_migra = migra[_n-1]
gen lag_trade = trade[_n-1]
gen lag_gdpgrowth = gdpgrowth[_n-1]
gen lag_lngdp = lngdp[_n-1]
gen lag_pop = lnpop[_n-1]
gen lag_polity = polity[_n-1]
gen lag_sanctions = sanction2[_n-1]
gen lag_elections = elections[_n-1]
gen lag_protest = protest[_n-1]
gen lag_remelect = remelect[_n-1]
gen lag_ciri = ciri[_n-1]
gen lag_ciri2 = ciri[_n-2]
gen lag_Ciri = Ciri[_n-1]
gen lag_Ciri2 = Ciri[_n-2]

gen lag_civil2 = civil[_n-2]
gen lag_remit2 = Remit_gdp[_n-2]
gen lag_remprot2 = remprot[_n-2]
gen lag_remcivil2 = remcivil[_n-2]
gen lag_mepv2 = mepv[_n-2]
gen lag_imf2 = imf[_n-2]
gen lag_migra2 = migra[_n-2]
gen lag_trade2 = trade[_n-2]
gen lag_gdpgrowth2 = gdpgrowth[_n-2]
gen lag_lngdp2 = lngdp[_n-2]
gen lag_pop2 = lnpop[_n-2]
gen lag_polity2 = polity[_n-2]
gen lag_sanctions2 = sanction2[_n-2]
gen lag_elections2 = elections[_n-2]
gen lag_protest2 = protest[_n-2]
gen lag_remelect2 = remelect[_n-2]




**********************************************************************
***TABLE 1*****************(ROBUSTNESS CHECK)************************
**********************************************************************
***Table 1, CIRI
xtpcse Ciri lag_Ciri Remit_gdp mepv imf NetMigrat gdpgrowth lnpop trade polity sanction2 elections civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store A, title(Remit*prot)

*** Table 1, CIRI -1
xtpcse Ciri lag_Ciri lag_remit lag_mepv lag_imf NetMigrat lag_gdpgrowth lag_pop lag_trade lag_polity lag_sanctions lag_elections lag_civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store B, title(Remit*elect1)

***Table 1, CIRI -2
xtpcse Ciri lag_Ciri2 lag_remit2 lag_mepv2 lag_imf2 NetMigrat lag_gdpgrowth2 lag_pop2 lag_trade2 lag_polity2 lag_sanctions2 lag_elections2 lag_civil2 nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store C, title(Remit*elect2)


esttab A B C, star(+ 0.10 * 0.05) se ar2
esttab A B C, se ar2


xtreg Ciri lag_Ciri Remit_gdp mepv imf NetMigrat gdpgrowth lnpop trade polity sanction2 elections civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store A, title(Remit*prot)

*** Table 1, CIRI -1
xtreg Ciri lag_Ciri lag_remit lag_mepv lag_imf NetMigrat lag_gdpgrowth lag_pop lag_trade lag_polity lag_sanctions lag_elections lag_civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store B, title(Remit*elect1)

***Table 1, CIRI -2
xtreg Ciri lag_Ciri2 lag_remit2 lag_mepv2 lag_imf2 NetMigrat lag_gdpgrowth2 lag_pop2 lag_trade2 lag_polity2 lag_sanctions2 lag_elections2 lag_civil2 nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store C, title(Remit*elect2)


esttab A B C, star(+ 0.10 * 0.05) se ar2
esttab A B C, se ar2


***Table 1, CIRI
ologit Ciri lag_Ciri Remit_gdp mepv imf NetMigrat gdpgrowth lnpop trade polity sanction2 elections civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store A, title(Remit*prot)

*** Table 1, CIRI -1
ologit Ciri lag_Ciri lag_remit lag_mepv lag_imf NetMigrat lag_gdpgrowth lag_pop lag_trade lag_polity lag_sanctions lag_elections lag_civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store B, title(Remit*elect1)

***Table 1, CIRI -2
ologit Ciri lag_Ciri2 lag_remit2 lag_mepv2 lag_imf2 NetMigrat lag_gdpgrowth2 lag_pop2 lag_trade2 lag_polity2 lag_sanctions2 lag_elections2 lag_civil2 nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store C, title(Remit*elect2)


esttab A B C, star(+ 0.10 * 0.05) se ar2
esttab A B C, se ar2



*****************************************************
****TWO STEP MODELS TO TEST THE STEPS OF OUR ARGUMENT
*****************************************************

***********TABLE 2************
******************************

***Time T 
***WHAT IS THE EFFECT OF REMITTANCES ON PROTEST (we want to know how much do remittances impact the probability of protest)
ologit civil lag_civil Remit_gdp mepv imf gdpgrowth NetMigrat lnpop trade polity sanction2 elections nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store A, title(Remit*elect)

***Time T - 1
***WHAT IS THE EFFECT OF REMITTANCES ON PROTEST
ologit civil lag_civil lag_remit lag_mepv lag_imf lag_gdpgrowth NetMigrat lag_pop lag_trade lag_polity lag_sanctions lag_elections nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store A, title(Remit*elect)

***Time T - 2
***WHAT IS THE EFFECT OF REMITTANCES ON PROTEST
ologit civil lag_civil2 lag_remit2 lag_mepv2 lag_imf2 lag_gdpgrowth2 NetMigrat lag_pop lag_trade2 lag_polity2 lag_sanctions2 lag_elections2 nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21
estimates store A, title(Remit*elect)



***********TABLE 3************
******************************

***Time T 
*****IF I HAVE REMITTANCES AND ELECTIONS, WHAT IS THE EFFECT OF PROTEST ON CIRI
heckman Ciri lag_Ciri Remit_gdp mepv imf gdpgrowth lnpop NetMigrat trade polity sanction2 elections civil nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21, select(Remit_gdp elections) twostep
estimates store A, title(Remit*elect)
esttab A, star(+ 0.10 * 0.05) se ar2
esttab A, se ar2

***Time T - 1
*****IF I HAVE REMITTANCES AND ELECTIONS, WHAT IS THE EFFECT OF PROTEST ON CIRI
heckman Ciri lag_Ciri lag_remit lag_mepv lag_imf lag_gdpgrowth lag_pop lag_trade lag_polity lag_sanctions lag_elections lag_civil lag_remelect nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21, select(Remit_gdp elections) twostep
estimates store B, title(Remit*elect)
esttab B, star(+ 0.10 * 0.05) se ar2
esttab B, se ar2

***Time T - 2
*****IF I HAVE REMITTANCES AND ELECTIONS, WHAT IS THE EFFECT OF PROTEST ON CIRI
heckman Ciri lag_Ciri2 lag_remit2 lag_mepv2 lag_imf2 lag_gdpgrowth2 NetMigrat lag_pop2 lag_trade2 lag_polity2 lag_sanctions2 lag_elections2 lag_civil2 nat1 nat2 nat3 nat4 nat5 nat6 nat7 nat8 nat9 nat10 nat11 nat12/*
*/ nat13 nat14 nat15 nat16 nat17 nat18 nat19 nat20 nat21, select(Remit_gdp elections) twostep
estimates store C, title(Remit*elect)
esttab C, star(+ 0.10 * 0.05) se ar2
esttab C, se ar2


